//
//  MyMeetingEndpoint.swift
//  CleanArchitecture
//
//  Created by siri on 2024/11/19.
//  Copyright © 2024 Tuan Truong. All rights reserved.
//

import APIService
import Foundation

enum MyMeetingEndpoint {
    case findMyMonthMeetings(appointDate: String)
    case findMyDayMeetingsInfo(appointDate: String)

}

extension MyMeetingEndpoint: Endpoint {
    var base: String? {
        "http://10.10.0.228:8880"
    }
    
    var path: String? {
        switch self {
        case .findMyMonthMeetings:
            return "/ZYMService/ZYYD/findMyMonthMeetingsInfo"
        case .findMyDayMeetingsInfo:
            return "/ZYMService/ZYYD/findMydayMeetingsInfo"
        }
    }
    
    var urlString: String? {
        switch self {
        default:
            return nil
        }
    }
    var httpMethod:HttpMethod{
        switch self {
        case .findMyMonthMeetings:
            return HttpMethod.post
        case .findMyDayMeetingsInfo:
            return HttpMethod.post
        }
    }
    var headers: [String: Any]? {
        switch self {
        case .findMyMonthMeetings:
            return ["Content-Type":"application/json","token":SettingsManager.shared.getToken()]
        case .findMyDayMeetingsInfo:
            return ["Content-Type":"application/json","token":SettingsManager.shared.getToken()]
        }
    }
    var body: [String: Any]? {
        switch self {
        case let .findMyMonthMeetings(appointDate):
            return [
                "findMyMonthMeetingsInfoVO":[
                    "appointDate" : appointDate
                ]
            ]
        case let .findMyDayMeetingsInfo(appointDate):
            return [
                "findMyDayMeetingsInfoVO":[
                    "appointDate" : appointDate
                ]
            ]
        }
        
    }
}
